﻿@using MrCMS.Indexing.Management
@model System.Collections.Generic.List<MrCMS.Indexing.Management.LuceneFieldBoost>

@{ Layout = "~/Areas/Admin/Views/Shared/_LayoutPopup.cshtml";}

@using (Html.BeginForm("Boosts", "Indexes", new { id = "" }, FormMethod.Post))
{
    <fieldset>
        <legend>@Resource("Admin Index Boosts Title", "Update field boosts")
            <span class="btn-group display-inline pull-right">
                <input type="submit" class="btn-success btn" value="@Resource("Update")" />
            </span>
        </legend>
        <div class="row">
            <div class="col-lg-12">
                <table class="table table-condensed table-striped">
                    <thead>
                        <tr>
                            <th class="col-lg-10">
                                @Resource("Name")
                            </th>
                            <th class="col-lg-2">
                                @Resource("Admin Index Boosts Boost", "Boost")
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @for (int i = 0; i < Model.Count; i++)
                        {
                            <tr>
                                <td>
                                    @Html.HiddenFor(list => list[i].Id)
                                    @Html.HiddenFor(list => list[i].Site.Id)
                                    @Html.HiddenFor(list => list[i].Definition)
                                    @FieldDefinition.GetDisplayName(Model[i].Definition)
                                </td>
                                <td>
                                    @Html.TextBoxFor(list => list[i].Boost)
                                </td>
                            </tr> 
                        }
                    </tbody>
                </table>
            </div>
        </div>
    </fieldset>
}